package org.kev.transit;

import org.kev.transit.util.TransitConst;

import android.app.Activity;
import android.app.AlertDialog;
import android.os.Bundle;
import android.util.Log;
import android.view.Window;
import android.webkit.WebView;

/**
 * Class contains a web browser with and advertising space.  This allows the transit application
 * to display URL to the user.  This will be mainly be used to display advertising based 
 * on current GPS location.
 * @author kevin
 *
 */
public class BrowserActivity extends Activity{
	private WebView mView = null;
	/**
	 * Called when fist started
	 * 
	 * @param icicle
	 */
	@Override
	public void onCreate(Bundle icicle) {
		super.onCreate(icicle);
		try {
			requestWindowFeature(Window.FEATURE_PROGRESS);
			setContentView(R.layout.display);
	        setProgressBarVisibility(true);
	        setProgressBarIndeterminate(true);
	        
			mView = (WebView) findViewById(R.id.browser);
	
			mView.loadUrl("http://www.google.com");
   		 setProgressBarVisibility(false); 
		} catch (Exception e) {
			Log.e(TransitConst.TAG, "UKNOWN Error in " + this, e);
			//AlertDialog.show(this, "StackTrace", e.getMessage(), "Ok", false);
			
		}
	}
}
